use Qt endian detetion. (#619)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Fri, 7 Aug 2020 13:38:47 +0000 (07:38 -0600)
committerGitHub <noreply@github.com>
Fri, 7 Aug 2020 13:38:47 +0000 (07:38 -0600)
This frees us from AC_C_BIGENDIAN which conditionally defined WORDS_BIGENDIAN.
The defintion of WORDS_BIGENDIAN was and is not handled by GPSBabel.pro.

util.cc

diff --git a/util.cc b/util.cc
index 4e622fc51b72e845b6fd275639c718853049c809..448f64e3ef9ce2d22b25da668e64b605722884df 100644 (file)
--- a/util.cc
+++ b/util.cc
 #include "src/core/logging.h"           // for Warning
 #include "src/core/xmltag.h"            // for xml_tag, xml_attribute, xml_findfirst, xml_findnext
 
-// First test Apple's clever macro that's really a runtime test so
-// that our universal binaries work right.
-#if defined __BIG_ENDIAN__
-#define i_am_little_endian !__BIG_ENDIAN__
-#else
-#if defined WORDS_BIGENDIAN
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
 # define i_am_little_endian 0
-#else
+#elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN
 # define i_am_little_endian 1
-#endif
+#else
+# error Unhandled Endianness
 #endif
 
 void*